/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pckUtil;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author User
 */
    
    public class Conexion {
    String bd="mcolorsdb";
    String user="root";
    String pass="";
    String driver="com.mysql.jdbc.Driver";
    String url = "jdbc:mysql://localhost:3306/" + bd;
    private Connection cn= null;
    
    public Conexion(){
        try {
            Class.forName(driver);
             cn=DriverManager.getConnection(url,user,pass);
        } catch (SQLException ex) {
            System.out.println(ex);
        } catch (ClassNotFoundException ex) {
            System.out.println(ex);
        }
    }
    
    public Connection getConnection(){
    return cn;
    }
    
    }

